/**
 * 
 */
package org.framework2.utils;

import java.text.MessageFormat;

import org.apache.commons.logging.LogFactory;


/**
 * <p>
 * 日志工具类
 * </p>
 * @see 
 * @author ahli
 * @version WebServerTestMockV1, 2010-8-24
 * @since WebServerTestMockV1
 */
public class LogUtils {

	public static final String FORMAT = "[{0}]:{1}";
	
	private static final ThreadLocal<String> logID = new ThreadLocal<String>();
	
	public static void initLogID(){
		logID.set(IDUtils.uuid());
	}
	
	public static String format(Object message){
		return MessageFormat.format(FORMAT, new Object[]{logID.get(), message});
	}
	
	public static void info(String path, String message){
		LogFactory.getLog(path).info(format(message));
	}
}
